**********************************************************************************************
//*SET USER*//
*Users Identification Code
*User 1
*User 2
set more off

//Set user below:
global user 2

//Enter the filepath of where the Master Folder is located//
*********************************************************
//User 1
if $user == 1 {
	global FH ""
}
**********************************************************
//User 2
if $user == 2 {

	global FH ""
}
************************************************************
*************************PHILIPPINES************************
************************************************************
//GENERATING SCORES
do "$FH/do/Scores/PHL_HOC_Scores.do"


********************************************************************************************
//*RE-CLASSIFICATION OF BASELINE PARAMETERS*//

///RENAMING INDICATOR WHETHER PHONE IS SELF OWNED///
rename b_qg1 b_ownphone


///CLASSIFICATION OF RETAIL TYPE INTO 3 NEW TYPES: "SARI-SARI", "FOOD RETAIL" AND "NON-FOOD RETAIL"///
tab b_retailtype
tab b_retailtype, nol
gen b_retailtype_new = 1 if b_retailtype == 1
replace b_retailtype_new = 3 if b_retailtype == 8
replace b_retailtype_new = 2 if b_retailtype_new != 1 & b_retailtype_new != 3
tab b_retailtype_new
label variable b_retailtype_new "retail type revised classification"
label define retailnew 1"sari sari store" 2"food retail" 3"non-food retail"
label values b_retailtype_new retailnew
tab b_retailtype_new
tab b_retailtype_new, nol
tab b_retailtype_new, gen(b_retailtype_new_)
*********************************************************************************
///RE-CLASSIFICATION OF EDUCATION INTO 4 LEVELS: "LESS THAN 5TH CLASS", "ABOVE 5TH CLASS", "COMPLETED HIGH SCHOOL" & "GRADUATE/POST-GRADUATE"///
tab b_education
tab b_education, nol
gen b_education_new = 1 if b_education <= 2
replace b_education_new = 2 if b_education == 3
replace b_education_new = 3 if b_education == 4
replace b_education_new = 4 if b_education >= 5
tab b_education_new
label variable b_education_new "revised education level"
label define educationnew 1"less than 5th class" 2"above 5th class" 3"complete high school" 4"graduate / post graduate"
label values b_education_new educationnew
tab b_education_new
tab b_education_new, nol
tab b_education_new, gen(b_education_new_)


//RECODING PARAMTERS

gen b_average_score = (b_optimal_score + b_training_score)/2
replace es_total_pickup = es_total_pickup/21*100


//LABELING PREDICTORS
label var b_age "Age of Respondent"
labe var b_urbanclas "Urban"
label var b_ageofbus "Age of Business"
label var b_bus_prime "Business is Primary Source of Income"
label var b_ownphone "Own a Cellphone"
label var b_education_new_1 "Less than 5th Class"
label var b_education_new_2 "Above 5th Class"
label var b_education_new_3 "Completed High School"
label var b_retailtype_new_1 "Sari Sari Store"
label var b_retailtype_new_2 "Food Retail"
label var b_average_score "Baseline Practice Score"
label var log_b_salesregwk "Log-Baseline Regular Week Sales"
label var log_b_profitregwk "Log-Baseline Regular Week Profits"

//ENGAGEMENT PREDICTORS REGRESSION//
est clear
reg es_total_pickup b_age b_urbanclas b_ageofbus b_bus_prime b_ownphone b_education_new_1-b_education_new_3 b_retailtype_new_1-b_retailtype_new_2, cluster(groupid)

scalar b11 = round(_b[b_age], 0.001)
scalar b21 = round(_b[b_urbanclas], 0.001)
scalar b31 = round(_b[b_ageofbus], 0.001)
scalar b41 = round(_b[b_bus_prime], 0.001)
scalar b51 = round(_b[b_ownphone], 0.001)
scalar b61 = round(_b[b_education_new_1], 0.001)
scalar b71 = round(_b[b_education_new_2], 0.001)
scalar b81 = round(_b[b_education_new_3], 0.001)
scalar b91 = round(_b[b_retailtype_new_1], 0.001)
scalar b101 = round(_b[b_retailtype_new_2], 0.001)
scalar bcons1 = round(_b[_cons], 0.001)


scalar se11 = round(_se[b_age], 0.01)
scalar se21 = round(_se[b_urbanclas], 0.01)
scalar se31 = round(_se[b_ageofbus], 0.01)
scalar se41 = round(_se[b_bus_prime], 0.01)
scalar se51 = round(_se[b_ownphone], 0.01)
scalar se61 = round(_se[b_education_new_1], 0.01)
scalar se71 = round(_se[b_education_new_2], 0.01)
scalar se81 = round(_se[b_education_new_3], 0.01)
scalar se91 = round(_se[b_retailtype_new_1], 0.01)
scalar se101 = round(_se[b_retailtype_new_2], 0.01)
scalar secons1 = round(_se[_cons], 0.01)

scalar N1 = e(N)


reg es_total_pickup b_age b_urbanclas b_ageofbus b_bus_prime b_ownphone b_education_new_1-b_education_new_3 b_retailtype_new_1-b_retailtype_new_2 b_average_score log_b_salesregwk log_b_profitregwk, cluster(groupid)

scalar b12 = round(_b[b_age], 0.001)
scalar b22 = round(_b[b_urbanclas], 0.001)
scalar b32 = round(_b[b_ageofbus], 0.001)
scalar b42 = round(_b[b_bus_prime], 0.001)
scalar b52 = round(_b[b_ownphone], 0.001)
scalar b62 = round(_b[b_education_new_1], 0.001)
scalar b72 = round(_b[b_education_new_2], 0.001)
scalar b82 = round(_b[b_education_new_3], 0.001)
scalar b92 = round(_b[b_retailtype_new_1], 0.001)
scalar b102 = round(_b[b_retailtype_new_2], 0.001)
scalar b112 = round(_b[b_average_score], 0.001)
scalar b122 = round(_b[log_b_salesregwk], 0.001)
scalar b132 = round(_b[log_b_profitregwk], 0.001)
scalar bcons2 = round(_b[_cons], 0.001)

scalar se12 = round(_se[b_age], 0.01)
scalar se22 = round(_se[b_urbanclas], 0.01)
scalar se32 = round(_se[b_ageofbus], 0.01)
scalar se42 = round(_se[b_bus_prime], 0.01)
scalar se52 = round(_se[b_ownphone], 0.01)
scalar se62 = round(_se[b_education_new_1], 0.01)
scalar se72 = round(_se[b_education_new_2], 0.01)
scalar se82 = round(_se[b_education_new_3], 0.01)
scalar se92 = round(_se[b_retailtype_new_1], 0.01)
scalar se102 = round(_se[b_retailtype_new_2], 0.01)
scalar se112 = round(_se[b_average_score], 0.01)
scalar se122 = round(_se[log_b_salesregwk], 0.01)
scalar se132 = round(_se[log_b_profitregwk], 0.01)
scalar secons2 = round(_se[_cons], 0.01)

scalar N2 = e(N)


reg es_total_listenratio b_age b_urbanclas b_ageofbus b_bus_prime b_ownphone b_education_new_1-b_education_new_3 b_retailtype_new_1-b_retailtype_new_2, cluster(groupid)

scalar b13 = round(_b[b_age], 0.001)
scalar b23 = round(_b[b_urbanclas], 0.001)
scalar b33 = round(_b[b_ageofbus], 0.001)
scalar b43 = round(_b[b_bus_prime], 0.001)
scalar b53 = round(_b[b_ownphone], 0.001)
scalar b63 = round(_b[b_education_new_1], 0.001)
scalar b73 = round(_b[b_education_new_2], 0.001)
scalar b83 = round(_b[b_education_new_3], 0.001)
scalar b93 = round(_b[b_retailtype_new_1], 0.001)
scalar b103 = round(_b[b_retailtype_new_2], 0.001)
scalar bcons3 = round(_b[_cons], 0.001)


scalar se13 = round(_se[b_age], 0.01)
scalar se23 = round(_se[b_urbanclas], 0.01)
scalar se33 = round(_se[b_ageofbus], 0.01)
scalar se43 = round(_se[b_bus_prime], 0.01)
scalar se53 = round(_se[b_ownphone], 0.01)
scalar se63 = round(_se[b_education_new_1], 0.01)
scalar se73 = round(_se[b_education_new_2], 0.01)
scalar se83 = round(_se[b_education_new_3], 0.01)
scalar se93 = round(_se[b_retailtype_new_1], 0.01)
scalar se103 = round(_se[b_retailtype_new_2], 0.01)
scalar secons3 = round(_se[_cons], 0.01)

scalar N3 = e(N)


reg es_total_listenratio b_age b_urbanclas b_ageofbus b_bus_prime b_ownphone b_education_new_1-b_education_new_3 b_retailtype_new_1-b_retailtype_new_2 b_average_score log_b_salesregwk log_b_profitregwk, cluster(groupid)

scalar b14 = round(_b[b_age], 0.001)
scalar b24 = round(_b[b_urbanclas], 0.001)
scalar b34 = round(_b[b_ageofbus], 0.001)
scalar b44 = round(_b[b_bus_prime], 0.001)
scalar b54 = round(_b[b_ownphone], 0.001)
scalar b64 = round(_b[b_education_new_1], 0.001)
scalar b74 = round(_b[b_education_new_2], 0.001)
scalar b84 = round(_b[b_education_new_3], 0.001)
scalar b94 = round(_b[b_retailtype_new_1], 0.001)
scalar b104 = round(_b[b_retailtype_new_2], 0.001)
scalar b114 = round(_b[b_average_score], 0.001)
scalar b124 = round(_b[log_b_salesregwk], 0.001)
scalar b134 = round(_b[log_b_profitregwk], 0.001)
scalar bcons4 = round(_b[_cons], 0.001)

scalar se14 = round(_se[b_age], 0.01)
scalar se24 = round(_se[b_urbanclas], 0.01)
scalar se34 = round(_se[b_ageofbus], 0.01)
scalar se44 = round(_se[b_bus_prime], 0.01)
scalar se54 = round(_se[b_ownphone], 0.01)
scalar se64 = round(_se[b_education_new_1], 0.01)
scalar se74 = round(_se[b_education_new_2], 0.01)
scalar se84 = round(_se[b_education_new_3], 0.01)
scalar se94 = round(_se[b_retailtype_new_1], 0.01)
scalar se104 = round(_se[b_retailtype_new_2], 0.01)
scalar se114 = round(_se[b_average_score], 0.01)
scalar se124 = round(_se[log_b_salesregwk], 0.01)
scalar se134 = round(_se[log_b_profitregwk], 0.01)
scalar secons4 = round(_se[_cons], 0.01)

scalar N4 = e(N)


file open table3a using "$FH/tables/Table 3A.tex", write replace text
set more off

file write table3a "\documentclass[12pt]{article}" _n
file write table3a "\usepackage{amsmath}" _n
file write table3a "\usepackage{latexsym}" _n
file write table3a "\usepackage{amsfonts}" _n
file write table3a "\usepackage{xcolor}" _n
file write table3a "\usepackage{booktabs}" _n
file write table3a "\usepackage{tabularx}" _n
file write table3a "\usepackage{adjustbox}" _n

file write table3a "\begin{document}" _n
file write table3a "\begin{table}[htbp]" _n
file write table3a "\begin{adjustbox}{width=1.1\textwidth}" _n
file write table3a "\centering" _n
file write table3a "\small" _n
file write table3a "\begin{tabular}{p{7.75em}cccc}" _n
file write table3a "\multicolumn{5}{c}{\textbf{TABLE 3A: Predictors of Engagement-Philippines}} \\" _n
file write table3a "\midrule" _n
file write table3a "\midrule" _n
file write table3a "\multicolumn{1}{r}{} & \multicolumn{4}{c}{\textbf{Dependent Variables}} \\" _n
file write table3a "\cmidrule{2-5}    \multicolumn{1}{r}{} & \multicolumn{2}{c}{\textbf{\centering{Pick Up Rate (\%)}}} & \multicolumn{2}{p{10em}}{\centering{\textbf{Listenership- Regardless of Pickup(\%)}}}   \\" _n
file write table3a "\cmidrule{2-5}    \multicolumn{1}{l}{\textit{\textbf{Predictors}}} & \textbf{(1)} & \textbf{(2)} & \textbf{(3)} & \textbf{(4)} \\" _n
file write table3a "\midrule" _n
file write table3a "\multicolumn{1}{r}{} &      &       &       &  \\" _n
file write table3a "\multicolumn{1}{l}{Age of Respondent} & " (b11) "*** & " (b12) "** & " (b13) "** & " (b14) "** \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (se11) ") & (" (se12) ") & (" (se13) ") & (" (se14) ") \\" _n
file write table3a "\multicolumn{1}{l}{Urban} & " (b21) " & " (b22) " & " (b23) "* & " (b24) " \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (se21) ") & (" (se22) ") & (" (se23) ") & (" (se24) ") \\" _n
file write table3a "\multicolumn{1}{l}{Age of Business} & " (b31) " & " (b32) " & " (b33) " & " (b34) " \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (se31) ") & (" (se32) ") & (" (se33) ") & (" (se34) ") \\" _n
file write table3a "\multicolumn{1}{l}{Business is Primary Source of Income} & " (b41) " & " (b42) " & " (b43) "* & " (b44) " \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (se41) ") & (" (se42) ") & (" (se43) ") & (" (se44) ") \\" _n
file write table3a "\multicolumn{1}{l}{Own a Cellphone} & " (b51) "*** & " (b52) "*** & " (b53) "*** & " (b54) "*** \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (se51) ") & (" (se52) ") & (" (se53) ") & (" (se54) ") \\" _n
file write table3a "\multicolumn{1}{l}{Less than 5th class} & " (b61) "*** & " (b62) "** & " (b63) "** & " (b64) "** \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (se61) ") & (" (se62) ") & (" (se63) ") & (" (se64) ") \\" _n
file write table3a "\multicolumn{1}{l}{Above 5th class} & " (b71) "*** & " (b72) "*** & " (b73) "*** & " (b74) "*** \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (se71) ") & (" (se72) ") & (" (se73) ") & (" (se74) ") \\" _n
file write table3a "\multicolumn{1}{l}{Completed High School} & " (b81) "** & " (b82) "* & " (b83) "** & " (b84) "** \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (se81) ") & (" (se82) ") & (" (se83) ") & (" (se84) ") \\" _n
file write table3a "\multicolumn{1}{l}{Sari Sari Store} & " (b91) " & " (b92) " & " (b93) " & " (b94) " \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (se91) ") & (" (se92) ") & (" (se93) ") & (" (se94) ") \\" _n
file write table3a "\multicolumn{1}{l}{Food Retail} & " (b101) " & " (b102) " & " (b103) " & " (b104) " \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (se101) ") & (" (se102) ") & (" (se103) ") & (" (se104) ") \\" _n
file write table3a "\multicolumn{1}{l}{Baseline Practice Score} &    & " (b112) " &       & " (b114) " \\" _n
file write table3a "\multicolumn{1}{r}{} &       & (" (se112) ") &       & (" (se112) ") \\" _n
file write table3a "\multicolumn{1}{l}{Log-Baseline Regular Week Sales} &       & " (b122) "  &       & " (b124) " \\" _n
file write table3a "\multicolumn{1}{r}{} &       & (" (se122) ") &       & (" (se124) ") \\" _n
file write table3a "\multicolumn{1}{l}{Log-Baseline Regular Week Profits} &       & " (b132) " &       & " (b134) " \\" _n
file write table3a "\multicolumn{1}{r}{} &       & (" (se132) ") &       & (" (se134) ") \\" _n
file write table3a "\multicolumn{1}{l}{Constant} & " (bcons1) "*** & " (bcons2) "*** & " (bcons3) "*** & " (bcons4) "*** \\" _n
file write table3a "\multicolumn{1}{r}{} & (" (secons1) ") & (" (secons2) ") & (" (secons3) ") & (" (secons4) ") \\" _n
file write table3a "\multicolumn{1}{l}{N} & " (N1) "  & " (N2) "   & " (N3) "   & " (N4) " \\" _n
file write table3a "\midrule" _n
file write table3a "\midrule" _n
file write table3a "\multicolumn{5}{p{40em}}{Notes: This table presents the predictors of engagement in training. We regress pickup rate (\%) and listenership rate (\%) on characteristics of participants. Urban takes value 1 for urban particiapnts and 0 for rural participants. The fourth level of education is graduate/post graduate, which is omitted due to multicollinearity. The third type of business is non-food retail, which is omitted due to multicolinearity. Standard errors, clustered at the group-level, in parentheses. Business practice score, ranging from 1 to 3, is a scaled score such that higher score indicate better business practices. * Denotes significance at 10\%-level, ** at the 5\%-level, and *** at the 1\%-level.} \\" _n
file write table3a "\bottomrule" _n
file write table3a "\end{tabular}%" _n
file write table3a "\label{tab:addlabel}%" _n
file write table3a "\end{adjustbox}" _n
file write table3a "\end{table}%" _n
file write table3a "\end{document}"

file close table3a
set more on

************************************************************
*************************INDIA******************************
************************************************************
//*SET DIRECTORY & LOAD DATA & GENERATE SCORES*//
clear
do "$FH/do/Scores/INDW1_HOC_Scores.do"

********************************************************************************************
********************************************************************************************

//*RE-CLASSIFICATION OF BASELINE PARAMETERS*//

///CLASSIFICATION OF RETAIL TYPE INTO 3 NEW TYPES: "SHOP", "FOOD RETAIL" AND "NON-FOOD RETAIL"///

tab b_retailtype
tab b_retailtype, nol
gen b_retailtype_new = 1 if b_retailtype == 2
replace b_retailtype_new = 2 if b_retailtype == 1 | b_retailtype == 5 | b_retailtype == 9 | b_retailtype == 11
replace b_retailtype_new = 3 if b_retailtype_new != 1 & b_retailtype_new != 2
replace b_retailtype_new = . if b_retailtype < 0 | b_retailtype ==.
tab b_retailtype_new
label variable b_retailtype_new "Revised Retail Type Classification"
label define retailnew 1"Shop" 2"Food Retail" 3"Non-food Retail"
label values b_retailtype_new retailnew
tab b_retailtype_new
tab b_retailtype_new, nol
tab b_retailtype_new, gen(b_retailtype_new_)

*********************************************************************************
///RE-CLASSIFICATION OF EDUCATION INTO 4 LEVELS: "LESS THAN 5TH CLASS", "ABOVE 5TH CLASS", "COMPLETED HIGH SCHOOL" & "GRADUATE/POST-GRADUATE"///
tab b_education
tab b_education, nol
gen b_education_new = 1 if b_education <= 2
replace b_education_new = 2 if b_education == 3
replace b_education_new = 3 if b_education == 4
replace b_education_new = 4 if b_education >= 5
replace b_education_new = . if b_education < 0 | b_education ==.
tab b_education_new
label variable b_education_new "Revised Education Level"
label define educationnew 1"Less than 5th Grade" 2"Above 5th Grade" 3"Completed High School" 4"Graduate/Post-graduate"
label values b_education_new educationnew
tab b_education_new
tab b_education_new, nol
tab b_education_new, gen(b_education_new_)


//RENAMING INDICATOR ON WHETHER A PERSON OWNS A PHONE//
rename e_qg1 e_ownphone


//RECODING PARAMETERS//
gen log_b_salesregwk = log(b_salesregwk+1)
gen log_b_profitregwk = log(b_profitregwk+1)
gen b_average_score = (b_optimal_score + b_training_score)/2
gen es_total_pickuprate = es_total_pickup/22*100
drop if es_total_listenratio == -1

est clear

reg es_total_pickuprate b_age wave i._branch b_gender _language b_ageofbus e_ownphone b_education_new_1-b_education_new_3 b_retailtype_new_1-b_retailtype_new_2, r

scalar ind_b11 = round(_b[b_age], 0.001)
scalar ind_b21 = round(_b[b_gender], 0.001)
scalar ind_b31 = round(_b[b_ageofbus], 0.001)
scalar ind_b51 = round(_b[e_ownphone], 0.001)
scalar ind_b61 = round(_b[b_education_new_1], 0.001)
scalar ind_b71 = round(_b[b_education_new_2], 0.001)
scalar ind_b81 = round(_b[b_education_new_3], 0.001)
scalar ind_b91 = round(_b[b_retailtype_new_1], 0.001)
scalar ind_b101 = round(_b[b_retailtype_new_2], 0.001)
scalar ind_bcons1 = round(_b[_cons], 0.001)


scalar ind_se11 = round(_se[b_age], 0.01)
scalar ind_se21 = round(_se[b_gender], 0.01)
scalar ind_se31 = round(_se[b_ageofbus], 0.01)
scalar ind_se51 = round(_se[e_ownphone], 0.01)
scalar ind_se61 = round(_se[b_education_new_1], 0.01)
scalar ind_se71 = round(_se[b_education_new_2], 0.01)
scalar ind_se81 = round(_se[b_education_new_3], 0.01)
scalar ind_se91 = round(_se[b_retailtype_new_1], 0.01)
scalar ind_se101 = round(_se[b_retailtype_new_2], 0.01)
scalar ind_secons1 = round(_se[_cons], 0.01)

scalar ind_N1 = e(N)

reg es_total_pickuprate b_age wave i._branch b_gender _language b_ageofbus e_ownphone b_education_new_1-b_education_new_3 b_retailtype_new_1-b_retailtype_new_2 b_average_score log_b_salesregwk log_b_profitregwk, r

scalar ind_b12 = round(_b[b_age], 0.001)
scalar ind_b22 = round(_b[b_gender], 0.001)
scalar ind_b32 = round(_b[b_ageofbus], 0.001)
scalar ind_b52 = round(_b[e_ownphone], 0.001)
scalar ind_b62 = round(_b[b_education_new_1], 0.001)
scalar ind_b72 = round(_b[b_education_new_2], 0.001)
scalar ind_b82 = round(_b[b_education_new_3], 0.001)
scalar ind_b92 = round(_b[b_retailtype_new_1], 0.001)
scalar ind_b102 = round(_b[b_retailtype_new_2], 0.001)
scalar ind_b112 = round(_b[b_average_score], 0.001)
scalar ind_b122 = round(_b[log_b_salesregwk], 0.001)
scalar ind_b132 = round(_b[log_b_profitregwk], 0.001)
scalar ind_bcons2 = round(_b[_cons], 0.001)

scalar ind_se12 = round(_se[b_age], 0.01)
scalar ind_se22 = round(_se[b_gender], 0.01)
scalar ind_se32 = round(_se[b_ageofbus], 0.01)
scalar ind_se52 = round(_se[e_ownphone], 0.01)
scalar ind_se62 = round(_se[b_education_new_1], 0.01)
scalar ind_se72 = round(_se[b_education_new_2], 0.01)
scalar ind_se82 = round(_se[b_education_new_3], 0.01)
scalar ind_se92 = round(_se[b_retailtype_new_1], 0.01)
scalar ind_se102 = round(_se[b_retailtype_new_2], 0.01)
scalar ind_se112 = round(_se[b_average_score], 0.01)
scalar ind_se122 = round(_se[log_b_salesregwk], 0.01)
scalar ind_se132 = round(_se[log_b_profitregwk], 0.01)
scalar ind_secons2 = round(_se[_cons], 0.01)

scalar ind_N2 = e(N)



reg es_total_listenratio b_age wave i._branch b_gender _language b_ageofbus e_ownphone b_education_new_1-b_education_new_3 b_retailtype_new_1-b_retailtype_new_2, r

scalar ind_b13 = round(_b[b_age], 0.001)
scalar ind_b23 = round(_b[b_gender], 0.001)
scalar ind_b33 = round(_b[b_ageofbus], 0.001)
scalar ind_b53 = round(_b[e_ownphone], 0.001)
scalar ind_b63 = round(_b[b_education_new_1], 0.001)
scalar ind_b73 = round(_b[b_education_new_2], 0.001)
scalar ind_b83 = round(_b[b_education_new_3], 0.001)
scalar ind_b93 = round(_b[b_retailtype_new_1], 0.001)
scalar ind_b103 = round(_b[b_retailtype_new_2], 0.001)
scalar ind_bcons3 = round(_b[_cons], 0.001)


scalar ind_se13 = round(_se[b_age], 0.01)
scalar ind_se23 = round(_se[b_gender], 0.01)
scalar ind_se33 = round(_se[b_ageofbus], 0.01)
scalar ind_se53 = round(_se[e_ownphone], 0.01)
scalar ind_se63 = round(_se[b_education_new_1], 0.01)
scalar ind_se73 = round(_se[b_education_new_2], 0.01)
scalar ind_se83 = round(_se[b_education_new_3], 0.01)
scalar ind_se93 = round(_se[b_retailtype_new_1], 0.01)
scalar ind_se103 = round(_se[b_retailtype_new_2], 0.01)
scalar ind_secons3 = round(_se[_cons], 0.01)

scalar ind_N3 = e(N)

reg es_total_listenratio b_age wave i._branch b_gender _language b_ageofbus e_ownphone b_education_new_1-b_education_new_3 b_retailtype_new_1-b_retailtype_new_2 b_average_score log_b_salesregwk log_b_profitregwk, r

scalar ind_b14 = round(_b[b_age], 0.001)
scalar ind_b24 = round(_b[b_gender], 0.001)
scalar ind_b34 = round(_b[b_ageofbus], 0.001)
scalar ind_b54 = round(_b[e_ownphone], 0.001)
scalar ind_b64 = round(_b[b_education_new_1], 0.001)
scalar ind_b74 = round(_b[b_education_new_2], 0.001)
scalar ind_b84 = round(_b[b_education_new_3], 0.001)
scalar ind_b94 = round(_b[b_retailtype_new_1], 0.001)
scalar ind_b104 = round(_b[b_retailtype_new_2], 0.001)
scalar ind_b114 = round(_b[b_average_score], 0.001)
scalar ind_b124 = round(_b[log_b_salesregwk], 0.001)
scalar ind_b134 = round(_b[log_b_profitregwk], 0.001)
scalar ind_bcons4 = round(_b[_cons], 0.001)

scalar ind_se14 = round(_se[b_age], 0.01)
scalar ind_se24 = round(_se[b_gender], 0.01)
scalar ind_se34 = round(_se[b_ageofbus], 0.01)
scalar ind_se54 = round(_se[e_ownphone], 0.01)
scalar ind_se64 = round(_se[b_education_new_1], 0.01)
scalar ind_se74 = round(_se[b_education_new_2], 0.01)
scalar ind_se84 = round(_se[b_education_new_3], 0.01)
scalar ind_se94 = round(_se[b_retailtype_new_1], 0.01)
scalar ind_se104 = round(_se[b_retailtype_new_2], 0.01)
scalar ind_se114 = round(_se[b_average_score], 0.01)
scalar ind_se124 = round(_se[log_b_salesregwk], 0.01)
scalar ind_se134 = round(_se[log_b_profitregwk], 0.01)
scalar ind_secons4 = round(_se[_cons], 0.01)

scalar ind_N4 = e(N)



file open table3b1 using "$FH/tables/Table 3B.tex", write replace text
set more off

file write table3b1 "\documentclass[12pt]{article}" _n
file write table3b1 "\usepackage{amsmath}" _n
file write table3b1 "\usepackage{latexsym}" _n
file write table3b1 "\usepackage{amsfonts}" _n
file write table3b1 "\usepackage{xcolor}" _n
file write table3b1 "\usepackage{booktabs}" _n
file write table3b1 "\usepackage{tabularx}" _n
file write table3b1 "\usepackage{adjustbox}" _n

file write table3b1 "\begin{document}" _n

file write table3b1 "\begin{table}[htbp]" _n
file write table3b1 "\begin{adjustbox}{width=1.1\textwidth}" _n
file write table3b1 "\centering" _n
file write table3b1 "\small" _n
file write table3b1 "\begin{tabular}{p{7.75em}cccc}" _n
file write table3b1 "\multicolumn{5}{c}{\textbf{TABLE 3B: Predictors of Engagement-India}} \\" _n
file write table3b1 "\midrule" _n
file write table3b1 "\midrule" _n
file write table3b1 "\multicolumn{1}{r}{} & \multicolumn{4}{c}{\textbf{Dependent Variables}} \\" _n
file write table3b1 "\cmidrule{2-5}    \multicolumn{1}{r}{} & \multicolumn{2}{c}{\textbf{\centering{Pick Up Rate (\%)}}} & \multicolumn{2}{p{10em}}{\centering{\textbf{Listenership- Regardless of Pickup(\%)}}}   \\" _n
file write table3b1 "\cmidrule{2-5}    \multicolumn{1}{l}{\textit{\textbf{Predictors}}} & \textbf{(1)} & \textbf{(2)} & \textbf{(3)} & \textbf{(4)} \\" _n
file write table3b1 "\midrule" _n
file write table3b1 "\multicolumn{1}{r}{} &       &       &       &  \\" _n
file write table3b1 "\multicolumn{1}{l}{Age of Respondent} & " (ind_b11) " & " (ind_b12) " & " (ind_b13) " & " (ind_b14) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} & (" (ind_se11) ") & (" (ind_se12) ") & (" (ind_se13) ") & (" (ind_se14) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Female} & " (ind_b21) " & " (ind_b22) " & " (ind_b23) " & " (ind_b24) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} & (" (ind_se21) ") & (" (ind_se22) ") & (" (ind_se23) ") & (" (ind_se24) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Age of Business} & " (ind_b31) " & " (ind_b32) " & " (ind_b33) " & " (ind_b34) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} & (" (ind_se31) ") & (" (ind_se32) ") & (" (ind_se33) ") & (" (ind_se34) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Own a Cellphone} & " (ind_b51) "*** & " (ind_b52) "*** & " (ind_b53) "*** & " (ind_b54) "*** \\" _n
file write table3b1 "\multicolumn{1}{r}{} & (" (ind_se51) ") & (" (ind_se52) ") & (" (ind_se53) ") & (" (ind_se54) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Less than 5th class} & " (ind_b61) "** & " (ind_b62) "** & " (ind_b63) " & " (ind_b64) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} & (" (ind_se61) ") & (" (ind_se62) ") & (" (ind_se63) ") & (" (ind_se64) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Above 5th class} & " (ind_b71) " & " (ind_b72) " & " (ind_b73) " & " (ind_b74) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} & (" (ind_se71) ") & (" (ind_se72) ") & (" (ind_se73) ") & (" (ind_se74) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Completed High School} & " (ind_b81) " & " (ind_b82) " & " (ind_b83) " & " (ind_b84) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} & (" (ind_se81) ") & (" (ind_se82) ") & (" (ind_se83) ") & (" (ind_se84) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Shop} & " (ind_b91) "* & " (ind_b92) "* & " (ind_b93) "* & " (ind_b94) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} & (" (ind_se91) ") & (" (ind_se92) ") & (" (ind_se93) ") & (" (ind_se94) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Food Retail} & " (ind_b101) " & " (ind_b102) " & " (ind_b103) " & " (ind_b104) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} & (" (ind_se101) ") & (" (ind_se102) ") & (" (ind_se103) ") & (" (ind_se104) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Baseline Practice Score} &    & " (ind_b112) " &       & " (ind_b114) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} &       & (" (ind_se112) ") &       & (" (ind_se112) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Log-Baseline Regular Week Sales} &       & " (ind_b122) "  &       & " (ind_b124) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} &       & (" (ind_se122) ") &       & (" (ind_se124) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Log-Baseline Regular Week Profits} &       & " (ind_b132) " &       & " (ind_b134) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} &       & (" (ind_se132) ") &       & (" (ind_se134) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{Constant} & " (ind_bcons1) "*** & " (ind_bcons2) "** & " (ind_bcons3) "** & " (ind_bcons4) " \\" _n
file write table3b1 "\multicolumn{1}{r}{} & (" (ind_secons1) ") & (" (ind_secons2) ") & (" (ind_secons3) ") & (" (ind_secons4) ") \\" _n
file write table3b1 "\multicolumn{1}{l}{N} & " (ind_N1) "  & " (ind_N2) "   & " (ind_N3) "   & " (ind_N4) " \\" _n
file write table3b1 "\midrule" _n
file write table3b1 "\midrule" _n
file write table3b1 "\multicolumn{5}{p{40em}}{Notes: This table presents the predictors of engagement in training. We regress pickup rate (\%) and listenership rate (\%)on characteristics of participants, controlling for wave dummy and language. The fourth level of education is graduate/postgraduate, which is omitted due to multicollinearity. The third type of business is non-food retail, which is omitted due to multicollinearity. Heteroscedasticity-robust standard errors in parentheses. Business practice score, ranging from 1 to 3, is a scaled score such that higher score indicates better business practices. * Denotes significance at 10\%-level, ** at the 5\%-level, and *** at the 1\%-level.} \\" _n
file write table3b1 "\bottomrule" _n
file write table3b1 "\end{tabular}%" _n
file write table3b1 "\label{tab:addlabel}%" _n
file write table3b1 "\end{adjustbox}" _n
file write table3b1 "\end{table}%" _n
file write table3b1 "\end{document}"


file close table3b1
set more on

